#include "junix.h"
using namespace std;

class B
{
	public:
virtual B& f () {
     std::cout<<"B"<<std::endl; 
     return *this;
}
	protected:
	private:
};

class D:public B
{
	public:
virtual D& f () {
     std::cout<<"D"<<std::endl;
     return *this;

}
	protected:
	private:
};

int main(int argc, char **argv)
{
   B* pb = new D;
   pb->f();
}
